package com.example.springjpa.receiver;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @description:
 * @author: zsw
 * @time: 2021/7/31 12:53
 */
@Component
public class DirectReceiver {

    @RabbitHandler
    @RabbitListener(queues = "TestDirectQueue")//监听的队列名称 TestDirectQueue
    public void process(Map testMessage) {
        System.out.println("DirectReceiver消费者收到消息  : " + testMessage.toString());
    }
    @RabbitHandler
    @RabbitListener(queues = "topic.man")
    public void process1(Map testMessage) {
        System.out.println("topic.man消费者收到消息  : " + testMessage.toString());
    }

    @RabbitHandler
    @RabbitListener(queues = "topic.woman")
    public void process2(Map testMessage) {
        System.out.println("woman消费者收到消息  : " + testMessage);
    }


    @RabbitHandler
    @RabbitListener(queues = "topic12.zsw")
    public void process3(Map testMessage) {
        System.out.println("zsw消费者收到消息  : " + testMessage);
    }

}
